package com.jdkj.tools.controller;


import com.jdkj.tools.domain.LoginDTO;
import com.jdkj.tools.util.AjaxResult;
import com.jdkj.tools.util.LoginUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/user")
public class LoginController {

     @Autowired
     private LoginUtil loginUtil;

      @PostMapping
      public AjaxResult login(@RequestBody LoginDTO loginDTO){
          //先登录
          loginUtil.getCookie(loginDTO.getUsername(), loginDTO.getPassword());
          return AjaxResult.success();
      }


}
